package com.feijiang.mapper;

import com.feijiang.entity.ExpeRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2021-12-28
 */
public interface ExpeRecordMapper extends BaseMapper<ExpeRecord> {

  /**
   * 分页查询实验记录
   * @param pageSize
   * @param i
   * @return
   */
  @Select("select * from tb_expe_record where expe_id = #{expeId} limit #{i}, #{pageSize}")
  List<ExpeRecord> queryByPage(@Param("pageSize") int pageSize, @Param("i") int i, @Param("expeId")int expeId);

  @Select("select * from tb_expe_record limit #{i}, #{pageSize}")
  List<ExpeRecord> listAllByPage(@Param("pageSize") int pageSize, @Param("i") int i);

  @Delete("delete from tb_expe_record where expe_id = #{expe_id}")
  int deleteByExprId(@Param("expe_id") int exprId);
}
